//File: Engine.cpp
#include "E_Engine.h"

#include <GL\glew.h>
#include <GL\glfw.h>
#include "E_Render.h"
#include "Utility.h"

// |------- class CEngine -------|
bool CEngine::m_Run = false;

CEngine::CEngine()
{

}
CEngine::~CEngine()
{

}

void CEngine::Begin()
{	
	Utility::Log("Engine: Begin()");
	m_Run = true;
	Render::Window_Begin();

	MainLoop();

}
void CEngine::End()
{
	Utility::Log("Engine: End()");
	m_Run = false;
	Render::Window_End();
}

void CEngine::MainLoop()
{
	while (m_Run == true && glfwGetWindowParam( GLFW_OPENED ) )
	{

		Render::Draw();
	}
	Utility::Log("Engine: Mainloop terminated.");
	End();
}


